import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-update-jc',
  templateUrl: './update-jc.component.html',
  styleUrls: ['./update-jc.component.less'],
})
export class UpdateJCComponent implements OnInit {
  constructor(private http: HttpClient) {}

  ngOnInit(): void {}
  getUpdateJC() {
    this.http
      .get(`http://127.0.0.1:7001/pdf/UpdateJC`, {
        responseType: 'blob',
      })
      .subscribe((res) => {
        const url = URL.createObjectURL(res);
        const a = document.createElement('a');
        a.href = url;
        a.download = 'UpdateJC.txt';
        a.click();
      });
  }
}
